using Microsoft.Practices.Unity;

namespace Sessionizer.Core.Unity
{
    /// <summary>
    /// Lifetime menager for session instances.
    /// Resolves current bound session.
    /// Throws exception if no bound session.
    /// </summary>
    internal sealed class SessionGuardLifetimeManager : LifetimeManager
    {
        public override object GetValue()
        {
            return Session.Current;
        }

        public override void SetValue(object newValue)
        {
        }

        public override void RemoveValue()
        {
        }
    }
}